class HierarchyNode
{
	
	public var name : String;
	public var parent : HierarchyNode;
	public var children : Array<HierarchyNode>;
	public var depth : Int;
	
	public function new(name : String, ?parent : HierarchyNode)
	{
		this.name = name;
		this.parent = parent;
		this.children = new Array();
		if (parent!=null)
			parent.children.push(this);
	}

	public function printchildren()
	{
		trace(this.name);
		if (children.length>0)
		{
			trace("children:");
			for (n in children)
			{
				n.printchildren();
			}			
			trace("....");
		}
	}
	
}
